package com.rui.study.algorithm.T_OutOfMemoryError;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2019-02-25 11:48
 **/
public class Foo {

    private int[] data = new int[10 * 1024 * 1024];


    public int take() {
        if (data != null && data.length > 0) {
            return data[0];
        }
        return -1;
    }

    public int[] fetch() {
        return this.data;
    }

    public int size() {
        if (data != null) {
            return data.length;
        }
        return 0;
    }
}
